/***************************************************************************
 *   Copyleft 2006-2007 by												   *
 *	 Iwanicki Krzysztof													   *
 *   <gamma.mini.pw.edu.pl/~iwanickik>									   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 ***************************************************************************/
#ifndef __MACROS_H__
#define __MACROS_H__

#include <math.h>
#include "../Types/Types.h"
#include "./../Framework/Math/MathConstants.h"
#include "../Externals/Externals.h"
#include "../Logger/FileOutput.h"

#define LOGS				(*Externals::mLogs)
#define LOGS_OPEN			Externals::mLogs = new FileOutput(); \
							Externals::mLogs->Open();
#define LOGS_CLOSE			if (Externals::mLogs) { \
								Externals::mLogs->Close(); \
								delete Externals::mLogs; \
								Externals::mLogs = cNull; \
							}

#define SIN(x)				(sinf((cFloat) x))
#define COS(x)				(cosf((cFloat) x))

#define SIN_FROM_ANGLE(x)	(sinf((PI * ((cFloat) x) / 180.0f)))
#define COS_FROM_ANGLE(x)	(cosf((PI * ((cFloat) x) / 180.0f)))

#endif // __MACROS_H__